<template>
  <div class="app-container">
    <FormCom class="form-search" ref="form" :columns="queryColumns" labelWidth="3em" />
    <div class="fl-right mb20" style="margin-top:20px;padding-right: 60px;">
      <el-button type="primary" @click="handleSave">保存</el-button>
    </div>
  </div>
</template>

<script>
  export default {
    name: "IndexFooter",
    data() {
      this.queryColumns = [
        {text: "编码", name: "slug", type: "input",size:12,props:{disabled:true}},
        {text: "标题", name: "title", type: "input",size:12,props:{disabled:true}},
        {text: "内容", name: "html", type: "ueditor"},
      ]
      return {}
    },
    mounted() {
      this.getList();
    },
    methods: {
      getList(){
        this.api("web.get","42")
          .then((res)=>{
            let data = res.data;
            this.$refs.form.setData(data)
          })
      },
      handleSave(){
        let data = this.$refs.form.getData();
        this.api("web.edit",data)
          .then(()=>{
            this.$message.success("已保存")
          })
      }
    }
  };
</script>
